using UnityEngine;
using UnityEngine.UI;

namespace Assets.Scripts.Entities
{
    internal class ChildTipsIndicator : MonoBehaviour
    {
        [SerializeField] private Child _child;
        [SerializeField] private Image _filler;

        private void Update()
        {
            if (_child != null)
            {
                _filler.fillAmount = 1f - _child.TimeToGetTipsProgress;
                
                if (_child.TimeToGetTipsProgress >= 1f)
                {
                    Destroy(gameObject);
                }
            }
        }
    }
}
